const state = {
  tabArr: []
}
const mutations = {
  ADD_TABARR: (state, log) => {
    console.log(state, log, 'add')
    state.tabArr.push(log)
  },
  UPDATE_TABARR: (state, log) => {
    console.log(state, log, 'update')
    state.tabArr = log
  },
  REMOVE_TABARR: (state, index) => {
    state.tabArr.splice(index, 1)
    console.log(state.tabArr, index, 'remove')
  },
  CLEAR_TABARR: (state, index) => {
    state.tabArr = []
    console.log('clear tabarr')
  }
}
const actions = {
  addTabArr({ commit }, log) {
    commit('ADD_TABARR', log)
  },
  removeTabArr({ commit }) {
    commit('REMOVE_TABARR')
  },
  updateTabArr({ commit }) {
    commit('UPDATE_TABARR')
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
